package edu.sctu.practice.class02.shilaihong.assign08.three;

import java.awt.*;

/**
 * Created by admin on 2015/12/22.
 */
public class ImageCanvas extends Canvas {
    Image image = null;

    public ImageCanvas() {
        setSize(200, 200);
    }

    public void paint(Graphics g) {
        if (image != null)
            g.drawImage(image, 0, 0, this);
    }

    public void setImage(Image image) {
        this.image = image;
    }

}
